package io.geekidea.boot.vipmanagement.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.vipmanagement.dto.VipmanagementDto;
import io.geekidea.boot.vipmanagement.entity.Vipmanagement;
import io.geekidea.boot.vipmanagement.mapper.VipmanagementMapper;
import io.geekidea.boot.vipmanagement.query.VipmanagementQuery;
import io.geekidea.boot.vipmanagement.service.VipmanagementService;
import io.geekidea.boot.viptype.entity.Viptype;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class VipmanagementServiceImpl extends ServiceImpl<VipmanagementMapper, Vipmanagement> implements VipmanagementService {

    @Resource
    private VipmanagementMapper vipmanagementMapper;

    @Override
    public Boolean delById(Integer id) {
        return vipmanagementMapper.delById(id)>0;
    }

    @Override
    public List<Viptype> getAll() {
        return vipmanagementMapper.getAll();
    }

    @Override
    public boolean updateId(VipmanagementDto vipmanagementDto) {
        return vipmanagementMapper.updateId(vipmanagementDto)>0;
    }


    @Override
    public Page<Vipmanagement> vipmanagementPage(Page<Vipmanagement> page, VipmanagementQuery vipmanagementQuery){
        return vipmanagementMapper.getVipmanagementPageList(page,vipmanagementQuery);
    }
}
